MasterGear for BeOS v1.0b6
--------------------------
	1997 Brian Verre (wverre@execpc.com)
	Portions 1996-7 Marat Fayzullin
	Thanks go out to Michael Stochosky and Jesper Hansen.

 DISCLAIMERS:

	 MasterSystem and GameGear are registered trademarks of SEGA.
	 The author is in no way affiliated with SEGA.
	 The author is in no way affiliated with any pirate group out there.
	 The author can not provide you with MasterSystem/GameGear games.

NOTE:	The following web page is probably the best resource online for
		Sega Master System related info. If you own a SEGA brand game, I
		hear you can probably find a dump of it there as well. They also
		have information on how to build your own copier.

	The Sega Notebook
	http://www.cen.uiuc.edu/~equinn/sega/segamain.html

 INDEX:

	I.   Key layout
	II.  Foreword from the author.
	III. Description & FAQ
	IV.  Registration plea
	V.   Version history

 I. KEY LAYOUT:

	Player 1:
	
		Joystick: Arrow keys. B: left shift. A: left option (on mac 	
		keyboards) or left alt (left command key on macs). Start: Return.
	
	Player 2 (MasterSystem only):
	
NOTE:	Capslock must be ON for second player controls to function!
	
		Joystick: Up=I, Down=K, Left=J, Right=L. B: Z. A: X. Start: X.

 II. FOREWORD FROM THE AUTHOR:

	This is the final release of MasterGear for DR8.
	
	I've decided to support MasterGear as freeware for the time being.
	Due to health altercations I was forced to stop work on further
	enhancements for quite some time. In fact, I finished this release
	one-handed (broken 	left wrist). This was my first real development
	for the BeOS, and has been 	quite a learning exercise. 
	
	Unfortunately, DR8 has really pushed its limits on my PowerMac clone
	(PowerTower 604/166). It has served me well for many core services,
	but I will have to wait until DR9 to implement the features we all
	want. My latest dilemmas have been the audio_server (which has been
	flipping out in various ways), and the fact BWindowScreens are not
	available at all on my machine (internal video). 
	
	For the next release (DR9), I am currently deciding whether to go
	BWindowScreen, multi-threaded blitter, or perhaps I could support
	both. Sound will be available as soon as I can access DR9's robust
	audio_server. In future DR9 releases you can expect network support,
	and a Z80 interpreter written in PowerPC assembler (Marat said to
	wait for MasterGear 1.1, which supports cycle based interrupts).
	
	MasterGear will be the flagship for an improved emulation technique.
	Though not fully implemented, this application now has a preliminary
	system for emulating monolithic hardware while taking full advantage
	of a multi-threaded, multi-processor environment such as BeOS. While
	most emulators are based on on main loop, with all subsystems being
	emulated in the same thread, I look to divide every facet of emulated
	hardware into its own thread, running in sync (the hard part) with the
	other processes. Currently, only the system dependant code is done in
	this manner, but soon the entire architecture will follow this
	template. As far as I know, this is the first time emulation has
	stepped into this arena, and thus this software has stopped being a
	port, and has started branching into new development. The hitch is
	that I only have a single cpu machine 	to work with (the harder
	part). :P
	
	Beginning with DR9, I will be introducing many more emulators, some of
	which were not possible under DR8 (no BWindowScreen support on my
	PowerMac), some aren't yet complete. I intend to implement syncronous
	multi-threaded emulation in all of these emulators when they move out
	of the development stage, and near 100% compatibility. To give you an
	idea of whats to come, here are some of the projects I'm involved
	with: Snes97 (Super Nintendo), Multi-Arcade Machine Emulator (Arcade),
	SEGA System 16 (Arcade), Magic Engine (PC Engine/TurboGrafx 16), GenEm
	(SEGA Mega Drive/Genesis) and possibly a NES emulator (if time
	allows). As you can see, I have a full plate. With the exception of
	Magic Engine, I plan for these all to be freeware emulators, provided
	out of the love of emulation. (donations are graciously accepted,
	however...)

 III. DESCRIPTION & FAQ:

NOTE:	If a Master System game refuses to work, load it up in a hex editor
		and check if the first 512 bytes ($0200) are zeros. If so, delete
		them! MasterGear will skip 512 byte headers automatically in the
		future.

		Also, if the icons don't show up, type 'chmod +x MasterGear' at
		the terminal, while in the directory you keep MasterGear in.


	What does it do?

	MasterGear is an "emulator" which runs game ROMs from the classic
	SEGA Master System, and the portable SEGA Game Gear. The hardware
	itself requires no ROMs, and thus is legally distributable.
	
	Although the MasterGear source was orginally written for uniprocessor
	machines, it has been extensively recoded to take advantage of BeOS's
	superior architecture. Although the hardware being emulated is also
	of uniprocessor design, I am currently developing a method of multi-
	threading some core sections. When complete, I will be able to migrate
	this to other emulators as well.
	
	What is "emulation" and how does it differ from "simulation"?
	
	Emulation is an attempt to imitate the internal design of a device. 
	Simulation is an attempt to imitate functions of a device. For example,
	a program imitating the Pacman arcade hardware and running real Pacman
	ROM on it is an emulator. A Pacman game written for your computer but 
	using graphics similar to a real arcade is a simulator. Keep in mind
	that emulation is probably the most-processor intensive code around,
	and it will often take a powerful machine to emulate a rather 'simple'
	piece of hardware.
	
	Is it legal to emulate the proprietary hardware?
	
	Yes, although there is some controversy about it. However, many
	big gaming companies--including Atari and the makers of Intellivision--
	have recently been developing and marketing emulators of their own.
	
	Given that all information needed to create this emulator was obtained
	legally, no problems should arise from its use and distribution. In
	fact, SEGA almost purchased the rights to GenEm, a Mega Drive/Genesis
	emulator. It is illegal to distribute ROMs with the emulator if they
	are copyrighted, however.

 REGISTRATION PLEA:

	Why register?
	
	Why not? The registration will help me out greatly. I'm a high school
	student preparing for college (liberal arts), and computing is my
	livelyhood for the time being (literally, I do graphical design work).
	If you would like to send something (anything, really) to me, my
	postal address is:

	Brian Verre
	6796 N. Wildwood Pt Rd
	Hartland, WI	53029

	Programming is a non-profit job (some call it a hobby) for now, and any
	money received gives me reason to further update and improve this free
	software. Money is also encouragement to continue to develop emulation
	software for BeOS.

 VERSION HISTORY:

* Beta 6:

-	I am really going to make an effort at speeding up MasterGear after
	school gets out. I apologize to all the 66MHz BeBox users that cannot
	get full speed out of this application yet. (it'll get there!)
 
-	I made a mistake a while back: The frame skip values were all one
	off. No skips used to equal one skip, one equalled two, etc. Thus, 
	achieving maximum framerate was not possible! Oops. This is now fixed,
	and the default is now 'None' (60fps) rather than the old 'One'
	(15fps! yuck!).

-	Absolutely incredible application icon, courtesy of
	Jean-Francois Morreeuw. The cartridge icons are my attempt at
	"emulating" his style. ;)

-	Speed regulation routine completely redone for precision. Some fine 
	tuning may be necessary, but it seems to work well on my machine.
-	Second player support for MasterSystem games. Sorry for not adding
	this one earlier!

* Beta 5:

-	In my big rush to fix the menu bug, I had mistakenly left the
	maximum screen size at 3x instead of 2x. Yucky.

-	Screen now blanks between loading carts. No more artifacts from
	MasterSystem games when loading GameGear games.

-	Slight speedup in refresh routine (eliminated excess function-call)

* Beta 4:

- 	Fixes an odd BMenu bug that caused crashes on some peoples beboxen.

* Beta 3:

	Master System Games work, and have worked all along! I simply 
	forgot to strip the 512 byte header that is generated by some image
	copiers.

-	Speed limitation fixed, the last version ran a bit slow. You now
	have the option of making it faster, slower or turning it off. Joy!

-	Autofire emulation added.

-	Reset feature implemented.

-	Variable interrupts. (Note: you must reset the game to use the
	new selection.)

-	Overall Z80 emulation speed somewhat increased.

-	You can now select the frame skip rate!

* Beta 2:

-	Speed limited! (silly that I didn't do this in the first place)

-	Nasty quit bug fixed. No more wasted cycles.

-	Proofread this doc a bit.

* Beta 1:

-	Initial release.

 UPCOMING FEATURES:
Sooner:

- Even faster video routines (DR9 == full screen!)
- Increased emulation speed
- Full preferences
- Sound emulation

Later:

- BeBox Joystick support (I don't have a BeBox, so this could be 
  tricky... Anybody want this?)
- TCP/IP network support
- Any user requests

Have fun,
Brian Verre
wverre@execpc.com